package com.kate.mall.order.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kate.mall.common.utils.AbstractObject;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data;

/**
 * 购物车商品表
 * 
 * @author kate-chan
 * @email 857782993@qq.com
 * @date 2022-12-16 10:48:44
 */
@Data
@TableName(value = "oms_cart",autoResultMap = true)
public class CartEntity extends AbstractObject implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	@ApiModelProperty(value = "")
	@TableId(type = IdType.AUTO)
	private Integer id;
	/**
	 * 用户表的用户ID
	 */
	@ApiModelProperty(value = "用户表的用户ID")
	private Integer userId;
	/**
	 * 商品表的商品ID
	 */
	@ApiModelProperty(value = "商品表的商品ID")
	private Integer goodsId;
	/**
	 * 商品编号
	 */
	@ApiModelProperty(value = "商品编号")
	private String goodsSn;
	/**
	 * 商品名称
	 */
	@ApiModelProperty(value = "商品名称")
	private String goodsName;
	/**
	 * 商品货品表的货品ID
	 */
	@ApiModelProperty(value = "商品货品表的货品ID")
	private Integer productId;
	/**
	 * 商品货品的价格
	 */
	@ApiModelProperty(value = "商品货品的价格")
	private BigDecimal price;
	/**
	 * 商品货品的数量
	 */
	@ApiModelProperty(value = "商品货品的数量")
	private Integer number;
	/**
	 * 商品规格值列表，采用JSON数组格式
	 */
	@ApiModelProperty(value = "商品规格值列表，采用JSON数组格式")
	@TableField(typeHandler = com.kate.mall.common.typehandler.Json2StringTypeHandler.class)
	private String[] specifications;
	/**
	 * 购物车中商品是否选择状态
	 */
	@ApiModelProperty(value = "购物车中商品是否选择状态")
	private Boolean checked;
	/**
	 * 商品图片或者商品货品图片
	 */
	@ApiModelProperty(value = "商品图片或者商品货品图片")
	private String picUrl;
	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间")
	@TableField(fill = FieldFill.INSERT)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private LocalDateTime addTime;
	/**
	 * 更新时间
	 */
	@ApiModelProperty(value = "更新时间")
	@TableField(fill = FieldFill.INSERT_UPDATE)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private LocalDateTime updateTime;
	/**
	 * 逻辑删除
	 */
	@ApiModelProperty(value = "逻辑删除")
	@TableLogic
	private Boolean deleted;

}
